/*
 * @Author: 'zhangkeqq' '2211709169@qq.com'
 * @Date: 2025-07-25 12:00:32
 * @LastEditors: 'zhangkeqq' '2211709169@qq.com'
 * @LastEditTime: 2025-08-01 16:56:44
 * @FilePath: \vue3-admin-node\vue3-admin\src\api\login\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import instance from '@/http/index'
import type {loginFormData,verifyFormData,resetFormData} from './type'

//统一管理接口
enum API {
    REGISTER_URL = '/api/register',
    LOGIN_URL = '/api/login',
    VERIFYACCOUNTANDEMAIL_URL = '/user/verifyAccountAndEmail',
    CHANGEPASSWORD_URL = '/user/changePasswordInLogin',
    returnMenuList_url = '/api/returnMenuList',
}

//注册
export const register = (data:loginFormData)=>instance.post(API.REGISTER_URL,data)
//登录
export const login = (data:loginFormData)=>instance.post(API.LOGIN_URL,data)
//忘记密码验证
export const verify = (data:verifyFormData) => instance.post(API.VERIFYACCOUNTANDEMAIL_URL,data)
//密码重置
export const reset  = (data:resetFormData) => instance.post(API.CHANGEPASSWORD_URL,data)
//菜单
export const returnMenuList = (id:string | null) =>{
    return instance.post(API.returnMenuList_url,{id})
}
